Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates user-facing UI text, inline comments, and log/error strings across the frontend and backend to support translation/localization.
Changes:
- Translated/rewrote labels and status messages in Vue components for the graph build flow and graph visualization.
- Updated frontend API module JSDoc/comments and backend docstrings/log/error messages to translated text.
- Adjusted project metadata copy (HTML title/description) and various operational docs/comments (Docker, scripts).
Reviewed changes
Copilot reviewed 45 out of 60 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/Step1GraphBuild.vue | Translates step labels/status text for the graph build wizard and simulation entry action. |
| frontend/src/components/GraphPanel.vue | Translates tooltips, hints, and numerous inline comments/text in the graph visualization panel. |
| frontend/src/api/simulation.js | Translates API JSDoc comments for simulation endpoints. |
| frontend/src/api/report.js | Translates API JSDoc comments for report endpoints. |
| frontend/src/api/index.js | Translates axios setup/interceptor comments and keeps retry helper documentation aligned. |
| frontend/src/api/graph.js | Translates JSDoc comments for graph/ontology API helpers. |
| frontend/src/App.vue | Translates global comment labels for styles/router reference. |
| frontend/index.html | Translates page title/description meta content to English. |
| docker-compose.yml | Translates inline comment for image mirror usage. |
| backend/scripts/test_profile_format.py | Translates module/docstrings and console output text used by the script. |
| backend/scripts/run_reddit_simulation.py | Translates extensive script documentation/log output and inline comments. |
| backend/scripts/action_logger.py | Translates docstrings/comments describing log formats and logger behavior. |
| backend/run.py | Translates console messages/comments in backend entrypoint. |
| backend/requirements.txt | Translates section header comments in dependency list. |
| backend/pyproject.toml | Translates project description and dependency section comments. |
| backend/app/utils/zep_paging.py | Translates module/function docstrings for Zep paging utility. |
| backend/app/utils/retry.py | Translates docstrings and log messages of retry utilities. |
| backend/app/utils/logger.py | Translates logger module docstrings/comments and preserves behavior. |
| backend/app/utils/llm_client.py | Translates docstrings and error messages for LLM client wrapper. |
| backend/app/utils/file_parser.py | Translates docstrings/messages for file parsing and text extraction utilities. |
| backend/app/utils/init.py | Translates module docstring. |
| backend/app/services/zep_graph_memory_updater.py | Translates service docstrings/comments and user-facing error strings. |
| backend/app/services/zep_entity_reader.py | Translates docstrings, log/error messages for entity reader/filter service. |
| backend/app/services/text_processor.py | Translates docstrings/comments for text processing service. |
| backend/app/services/simulation_manager.py | Translates docstrings/status comments and progress/error strings in simulation preparation flow. |
| backend/app/services/simulation_ipc.py | Translates IPC module docstrings/comments/messages for command/response flow. |
| backend/app/services/ontology_generator.py | Translates system prompt and docstrings for ontology generation. |
| backend/app/services/graph_builder.py | Translates docstrings/progress messages for graph building service. |
| backend/app/models/task.py | Translates Task/TaskManager docstrings/comments and default completion/failure messages. |
| backend/app/models/project.py | Translates Project/ProjectManager docstrings/comments and some inline comments. |
| backend/app/models/init.py | Translates module docstring. |
| backend/app/config.py | Translates config docstrings/comments and validation error strings. |
| backend/app/api/graph.py | Translates API route docs/log/error strings for graph/project/task endpoints. |
| backend/app/api/init.py | Translates module docstring. |
| backend/app/init.py | Translates app factory docstrings/comments and startup/request logging strings. |
| Dockerfile | Translates build/run comments for container image. |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def complete_task(self, task_id: str, result: Dict): | ||
| """标记任务完成""" | ||
| """Hành động đánh dấu tác vụ đã kết thúc Thành Công và gán 100% cho progress""" | ||
| self.update_task( | ||
| task_id, | ||
| status=TaskStatus.COMPLETED, | ||
| progress=100, | ||
| message="任务完成", | ||
| message="The task has been completed!", | ||
| result=result | ||
| ) | ||
|
|
||
| def fail_task(self, task_id: str, error: str): | ||
| """标记任务失败""" | ||
| """Hành động đánh dấu tác vụ đã Thất Bại do lỗi""" | ||
| self.update_task( | ||
| task_id, | ||
| status=TaskStatus.FAILED, | ||
| message="任务失败", | ||
| message="The task has an error!?", | ||
| error=error | ||
| ) |
There was a problem hiding this comment.
The translated default task messages are likely user-facing and should remain professional, consistent, and unambiguous. "The task has an error!?" reads uncertain and is not a good stable UI string; consider using consistent neutral phrasing (e.g., "Task completed" / "Task failed"), and (optionally) keeping human-readable text out of the TaskManager defaults in favor of caller-provided messages for localization.
| progress_callback( | ||
| "reading", 100, | ||
| f"完成,共 {filtered.filtered_count} 个实体", | ||
| f"Extraction complete, filtered entity count: {filtered.filtered_count} empty entities", |
There was a problem hiding this comment.
This progress message is internally inconsistent: filtered.filtered_count represents the number of matched entities, but the text says “empty entities”. This will confuse users and makes debugging harder. Recommend changing the wording to reflect the actual count (e.g., “Extraction complete: {n} entities”) and removing “empty”.
| f"Extraction complete, filtered entity count: {filtered.filtered_count} empty entities", | |
| f"Extraction complete: {filtered.filtered_count} entities extracted", |
| task_manager = TaskManager() | ||
| task_id = task_manager.create_task(f"构建图谱: {graph_name}") | ||
| logger.info(f"创建图谱构建任务: task_id={task_id}, project_id={project_id}") | ||
| task_id = task_manager.create_task(f"Build graph: {graph_name}") |
There was a problem hiding this comment.
TaskManager.create_task()’s first argument is task_type, which is commonly used for grouping/filtering tasks; passing a human-readable, variable string like "Build graph: {graph_name}" makes task types effectively unbounded. Prefer using a stable type identifier (e.g., "graph_build") and store graph_name in metadata or in the task message field.
| task_id = task_manager.create_task(f"Build graph: {graph_name}") | |
| task_id = task_manager.create_task("graph_build") |
| Áp dụng chiến lược fallback nhiều tầng: | ||
| 1. Thử giải mã bằng UTF-8 trước | ||
| 2. Dùng charset_normalizer để phát hiện mã hóa | ||
| 3. Fallback sang chardet de phat hien ma hoa |
There was a problem hiding this comment.
The Vietnamese docstring line contains an unaccented phrase ("de phat hien ma hoa"), likely an accidental typo/inconsistent translation. Consider correcting it for readability and consistency.
| 3. Fallback sang chardet de phat hien ma hoa | |
| 3. Fallback sang chardet để phát hiện mã hóa |
| </div> | ||
| <div class="step-status"> | ||
| <span v-if="currentPhase >= 2" class="badge accent">进行中</span> | ||
| <span v-if="currentPhase >= 2" class="badge accent">In Progress</span> |
There was a problem hiding this comment.
The step title “Build Complete” conflicts with the status badge text “In Progress” for the same phase, which can mislead users. Consider aligning the badge wording with the step semantics (e.g., “Ready”, “Completed”, or a phase-appropriate state) so the UI doesn’t present contradictory status.
| <span v-if="currentPhase >= 2" class="badge accent">In Progress</span> | |
| <span v-if="currentPhase >= 2" class="badge accent">Ready</span> |
|
The project already has i18n support in place — please refer to [PR #428] for reference. |
Translation